﻿<!DOCTYPE html>

<html>
<head>
	<?php include 'functions.php'; 
	inclHeader();	
	logout();
	initializeCart();
	?>
	<link rel = "stylesheet"  type = "text/css" href = "CSS.css" />
	<meta charset = "utf-8">
	<title>Podutik Records</title>	
	<style type="text/css"></style>
	<script src="jquery.js"></script>
	<script src="myQuery.js"></script>
	<script type = "text/javascript"  src = "poizvedba.js"></script>
	<!--<script src="dodajanje.js" language="javascript">-->	
	<!--<embed height="100" width="100" src="Ray.mp3">-->
</head>

<body>
	<div id="page-container">

		<div id="main-nav">
			<div class="block" id="bl1">
				
			</div>
			<?php 			
				showMainNav();
			?>
					
		</div>
			
		<div id="sidebar-a">
			<div class="padding">
				<h3 id="bro">Browse</h3> 
				<ul class="tags">
					<li><a href="novo.php?type=everything" class="tag" id="eve">Top Sellers</a></li>
					<!--<li><a href="novo.php?type=top" class="tag" id="top">Top Sellers</a></li>-->
					<li><a href="novo.php?type=alternative" class="tag" id="alt">Alternative</a></li>
					<li><a href="novo.php?type=blues" class="tag" id="blu">Blues</a></li>
					<li><a href="novo.php?type=classical" class="tag" id="cla">Classical</a></li>
					<li><a href="novo.php?type=country" class="tag" id="cou">Country</a></li>
					<li><a href="novo.php?type=dance" class="tag" id="dan">Dance</a></li>
					<li><a href="novo.php?type=metal" class="tag" id="hea">Heavy Metal</a></li>
					<li><a href="novo.php?type=jazz" class="tag" id="jaz">Jazz</a></li>
					<li><a href="novo.php?type=latin" class="tag" id="lat">Latin</a></li>
					<li><a href="novo.php?type=live" class="tag" id="liv">Live</a></li>
					<li><a href="novo.php?type=oldies" class="tag" id="old">Oldies</a></li>
					<li><a href="novo.php?type=randb" class="tag" id="rin">R&amp;B</a></li>
					<li><a href="novo.php?type=raphiphop" class="tag" id="rap">Rap/Hip Hop</a></li>
					<li><a href="novo.php?type=rockpop" class="tag" id="roc">Rock/Pop</a></li>
					<li><a href="novo.php?type=soundtrack" class="tag" id="sou">Soundtrack</a></li>
				</ul>
					<?php
						displaySideCart();	
					?>
				
			</div>
		</div>
		
		<div id="header">		
				<a href="novo.php"><img id="logo1" src="podutikrecords1.jpg" 
				width="236" height="36" alt="Podutik Records" /></a>
		</div>
		
		<div id="search-bar">
			<form id="forma" method="post" action="#">
				<div class ="input">		
				<h3 id="sea" >Search:</h3> 
				<select name = "sort-by">
					<option id="art" value="izvajalec" <?php if(isset($_POST['sort-by'])) if($_POST['sort-by'] == "izvajalec") print("selected=\"selected\"")?>>Artist</option>
					<option id="alb" value="album" <?php if(isset($_POST['sort-by'])) if($_POST['sort-by'] == "album") print("selected=\"selected\"")?>>Album</option>
				</select>
					<input name = "search" value="<?php if(isset($_POST['search'])){ echo $_POST['search'];}?>" type = "text" size = "18">
				</div>
				<div class ="input" style="margin-left: 7px">
				<h3 id="sor" >Sort By:</h3>
					<select name = "sort-by1">
					  <option id="artistSort" value="izvajalec" <?php if(isset($_POST['sort-by1'])) if($_POST['sort-by1'] == "izvajalec") print("selected=\"selected\"")?>>Artist</option>
					  <option id="albumSort" value="album" 		<?php if(isset($_POST['sort-by1'])) if($_POST['sort-by1'] == "album") print("selected=\"selected\"")?>>Album</option>
					  <option id="priceSort" value="cena" 		<?php if(isset($_POST['sort-by1'])) if($_POST['sort-by1'] == "cena") print("selected=\"selected\"")?>>Price</option>		  
				   </select>
				</div>
				<div class ="input" style="float: right; margin-right: 0px;">
				<h3 id="sho">Show Only:</h3>
					<select name = "show-only">
					  <option id="ever" value="ever" <?php if(isset($_POST['show-only'])) if($_POST['show-only'] == "ever") print("selected=\"selected\"")?>>Everything</option>
					  <option id="cd" value="cd" 	 <?php if(isset($_POST['show-only'])) if($_POST['show-only'] == "cd") print("selected=\"selected\"")?>>CD</option>
					  <option id="lp" value="lp" 	 <?php if(isset($_POST['show-only'])) if($_POST['show-only'] == "lp") print("selected=\"selected\"")?>>LP</option>
					  <option value="00-10" 	 	 <?php if(isset($_POST['show-only'])) if($_POST['show-only'] == "00-10") print("selected=\"selected\"")?>>$0-$10</option>
					  <option value="10-20" 	 	 <?php if(isset($_POST['show-only'])) if($_POST['show-only'] == "10-20") print("selected=\"selected\"")?>>$10-$20</option>
					  <option value="20-30" 	 	 <?php if(isset($_POST['show-only'])) if($_POST['show-only'] == "20-30") print("selected=\"selected\"")?>>$20-$30</option>
					  <option value="30-40" 	 	 <?php if(isset($_POST['show-only'])) if($_POST['show-only'] == "30-40") print("selected=\"selected\"")?>>$30-$40</option>
					  <option value="40-50" 	 	 <?php if(isset($_POST['show-only'])) if($_POST['show-only'] == "40-50") print("selected=\"selected\"")?>>$40-$50</option>
					  <option value="50"    	 	 <?php if(isset($_POST['show-only'])) if($_POST['show-only'] == "50") print("selected=\"selected\"")?>>$50+</option>	
				   </select>
				</div>
				<br/>
				<?php
				if (isset($_GET["type"])){
					$tip = $_GET["type"];
					echo "<input id=\"tip\" style=\"display: none;\" value=\"$tip\">";
				}
				?>
				<div class="submitsrc">
					<button type="button" id="poizvedba" onclick="getArticles()">Submit search</button>
					<!--<button value="submit search">Submit search</button>-->
				</div>
				<!--
				<div class="pages">
					<h3 id="pag">Page:</h3>
					<a href="#">1</a>
					<a href="#">2</a>
					<a href="#">3</a>
					<a href="#">4</a>
					<a href="#">5</a>
				</div>-->
			</form>
		</div>
		
		<div id="content">
			<?php
				$query = createArtikelQuery();			
				$result = dbGetResult($query);
				printArtikelResult($result);
			?>		 
		</div>
		
		<?php
                    footer();
                ?>
	</div>
</body>
</html>

<?php
	novoAlerts();	
?>